
<script setup>
import { reactive, toRefs } from "vue"
// 解构赋值
const user = reactive({
  name: '张三',
  age: 18
})
const {name, age} = toRefs(user)
</script>

<template>
  <div>
    <p>姓名: {{name}}</p>
    <p>年龄: {{age}}</p>
    <button @click="age++">你长大了</button>
  </div>
</template>

